<?php
/**
 * Created by PhpStorm.
 * User: 秋刀鱼
 * Date: 2018/8/1
 * Time: 18:51
 */
use yii\helpers\Html;
use yii\widgets\ActiveForm;
header("Access-Control-Allow-Origin:*");

?>
<?=Html::cssFile('@web/css/common.css')?>
<?=Html::cssFile('@web/css/LdentitySelection.css')?>
<?=Html::cssFile('@web/css/animate.css')?>
<?=Html::jsFile('@web/js/jquery-1.11.3.min.js')?>
<body>
<div class="header">
    <div class="header_con">
        <div>
            <img src="../images/logo_select.png" />
        </div>
        <ul>
            <li><img src="../images/user.png" /></li>
            <li>
                <p>Yanna.Wang</p>
            </li>
            <li>|</li>
            <li>
                <p>退出</p>
            </li>
        </ul>
    </div>
</div>
<div class="center">
    <ul>
        <li id="expert">
            <div class="animated flash">
                <img src="../images/icon.png"/>
                <p>专家</p>
                <span>这是一段文字简介这是一段文字简介这是一段文字简介这是一段文字简介</span>
            </div>
        </li>
        <li id="Person">
            <div class="animated flash">
                <img src="../images/icon2.png"/>
                <p>负责人</p>
                <span>这是一段文字简介这是一段文字简介这是一段文字简介这是一段文字简介</span>
            </div>
        </li>
        <li id="Ordinary">
            <div class="animated flash">
                <img src="../images/icon3.png"/>
                <p>普通用户</p>
                <span>这是一段文字简介这是一段文字简介这是一段文字简介这是一段文字简介</span>
            </div>

        </li>
    </ul>
</div>
<script>
	var data = JSON.parse(sessionStorage.getItem('msg_data')).role
//	console.log(data)
	var data_role = [];	
		$(function(){
			for(var i=0;i<data.length;i++){
			data_role[i] = data[i].role_id
		}
			console.log(data_role)
		})
		
		var turn = function router(num){
			console.log(data_role);
		 for( var i=0; i<data_role.length; i++)
		 {
		 	console.log(num);
		 	
			if(data_role[i] == num )
			{
				return true;
				break;
			}	
					
		 }
			
		
		}
	$(document).on('click','#expert',function(){
		console.log(data_role);
			if(turn(1) == true){
					alert("成功");
					location.href="http://172.18.80.9:8087/admin/specialist/addcheck"
				}else{
					alert("失败");
				}
	})
	$(document).on('click','#Person',function(){

			if(turn(2) == true){
					alert("成功");
                location.href="http://172.18.80.9:8087/admin/principal/indexlist"
				}else{
					alert("失败");
				}
	})
	$(document).on('click','#Ordinary',function(){
			if(turn(3) == true){
					alert("成功")
				}else{
					alert("失败");
				}
	})
	
</script>
</body>
</html>
<?php exit;?>

